package main

import "fmt"

func sumOfUnique(nums []int) int {
	bucket := make([]int, 101)
	sum := 0
	for _, v := range nums {
		bucket[v]++
		if bucket[v] == 1 {
			sum += v
		} else if bucket[v] == 2 {
			sum -= v
		}
	}
	return sum
}

func main() {
	fmt.Println(sumOfUnique([]int{1, 1, 1, 1}))
	fmt.Println(sumOfUnique([]int{1, 2, 3, 2}))

}
